GtkApplication: fixes for NULL session bus
authorRyan Lortie <desrt@desrt.ca>
Mon, 30 Apr 2012 17:43:23 +0000 (13:43 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 30 Apr 2012 21:50:45 +0000 (17:50 -0400)
commitbabd137e325931ee7b791dec8df825ad1262a320
treec93ec0521c9d1ea68f977d1ea4574c667ba00715
parentcdf473ec100d23ea6a9a8750ad301307a116b674
GtkApplication: fixes for NULL session bus

We currently have a couple of cases where GtkApplication assumes that
the session bus will be non-NULL causing critical error output or (in
the case of trying to publish menus) an infinite loop.

Three fixes:

 - if the session bus is NULL due to not having registered the
   GtkApplication yet then give a g_critical on the entry point to the
   menu setters instead of going into an infinite loop.  Document this.

 - check for NULL session bus even when calling the menu setters at the
   right time in order to prevent the infinite loop for
   non-programer-error cases (ie: because we had trouble connecting to
   the session bus)

 - check for NULL session bus when publishing the X11 properties on the
   GtkApplicationWindow and skip publishing them if we're not on the bus

https://bugzilla.gnome.org/show_bug.cgi?id=671249
gtk/gtkapplication.c
gtk/gtkapplicationwindow.c